package com.immediatus.graphics.contracts;


public interface ITextureAtlas<T extends ITextureAtlasSource> extends ITexture{

    public void addTextureAtlasSource(final T textureAtlasSource_, final int texturePositionX_, final int texturePositionY_) throws IllegalArgumentException;

    public void removeTextureAtlasSource(final T textureAtlasSource_, final int texturePositionX_, final int texturePositionY_);

    public void clearTextureAtlasSources();

    @Override
    public ITextureAtlasStateListener<T> getTextureStateListener();

    public static interface ITextureAtlasStateListener<T extends ITextureAtlasSource> extends ITexture.ITextureStateListener{
        public void onTextureAtlasSourceLoadExeption(final ITextureAtlas<T> textureAtlas_, final T textureAtlasSource_, final Throwable throwable_);

        public static class TextureAtlasStateAdapter<T extends ITextureAtlasSource> implements ITextureAtlasStateListener<T>{
            @Override
            public void onLoadedToHardware(final ITexture pTexture){ }

            @Override
            public void onTextureAtlasSourceLoadExeption(final ITextureAtlas<T> textureAtlas_, final T textureAtlasSource_, final Throwable throwable_){ }

            @Override
            public void onUnloadedFromHardware(final ITexture texture_){ }
        }
    }
}
